package com.xjj.datarources.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xjj.datarources.dao.UserInfoMapper;
import com.xjj.datarources.pojo.UserInfo;
import com.xjj.datarources.service.UserInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @name: xjj
 * @date: 2021/5/25 15:01
 */
@Service
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> implements UserInfoService {

    @Resource
    private UserInfoMapper userInfoMapper;




    @Override
    public UserInfo findByName(String username) {
        QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username", username);

        return userInfoMapper.selectOne(queryWrapper);
    }


    @Override
    public List<UserInfo> findAll() {
        return userInfoMapper.selectList(null);
    }


}
